<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    // A 极权限: 权限码(0b1000)
    const A = 0b00000001
    // B 极权限: 权限码(0b0100)
    const B = 0b00000010
    // C 极权限: 权限码(0b0010)
    const C = 0b00000100
    // D 极权限: 权限码(0b0001)
    const D = 0b00001000
    const E = 0b00010000
    const F = 0b00100000
    const G = 0b01000000
    const H = 0b10000000

    const AB = A + B;

    const handles = {
        [A]: () => {},
        [B]: () => {},
        [C]: () => {},
        [D]: () => {},
    }

    console.log(A, B, C, D, E, F, G, H)
    console.log(AB & A)
    console.log(AB & B)
    console.log(AB & C)
    console.log(AB & D)

    function test () {
        console.log(handles)
        for(const [key, handle] of Object.entries(handles)) {
            console.log(key, AB & key, handle)
        }
    }

    test ();
</script>
</body>
</html>